/*
 * Project: Sudoku Hint Engine for Android
 * Copyright (C) 2010-2013 Emanuel Moecklin
 * 
 * Available under the terms of the Lesser General Public License (LGPL)
 */
package com.onegravity.sudoku.solver.data;

import java.util.BitSet;

/**
 * Immutable Cell needed because the Grid and its Cells might change
 * while an ImmutableCell is a snapshot in time and never changes.
 * @author Emanuel Moecklin
 */
public final class ImmutableCell extends Cell {

	private static final long serialVersionUID = -1816689941460139277L;

	public ImmutableCell(Cell cell) {
		super(cell.grid, cell.x, cell.y);
		value = cell.value;
		BitSet potentials = cell.potentialValues;
		potentialValues = (potentials==null) ? null : (BitSet) potentials.clone();
	}
	
    @Override
	public boolean equals(Object obj) {
    	if (! (obj instanceof ImmutableCell)) return false;
    	ImmutableCell another = (ImmutableCell) obj;
		return another.x==x && another.y==y && another.value==value;
	}
	
    public void addPotentialValue(int value) {}
    
    public void removePotentialValue(int value) {}

    public void removePotentialValues(BitSet valuesToRemove) {}

    public void clearPotentialValues() {}

    public void setValue(int value) {}

    public void setValueAndCancel(int value) {}

}